<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>公司设置</title>
    <link href="<{$ipath}>user/style/my_service_css.css" type="text/css" rel="stylesheet">
    <link href="<{$ipath}>user/style/my_account_css.css" type="text/css" rel="stylesheet">
    <script type="text/javascript"  src="<{$ipath}>public/js/head.js"></script>
    <script src="<{$ipath}>public/js/jquery.js" type="text/javascript"></script>
    <script src="<{$ipath}>artDialog/jquery.artDialog.js?skin=default"></script>
    <script src="<{$ipath}>artDialog/plugins/iframeTools.js"></script>
    <script src="<{$ipath}>user/js/region_select.js"></script>
    <script src="/lib/kdeditor/kindeditor.js" type="text/javascript"></script>
    <script src="/lib/kdeditor/lang/zh_CN.js" type="text/javascript"></script>
    <script src="/lib/kdeditor/plugins/code/prettify.js" type="text/javascript"></script>
    <script type="text/javascript"  src="<{$ipath}>wx/js/ajaxfileupload.js"></script>
	<style type="text/css">
		.erweima .txt_code{border:1px solid #e2e4e9;color:#666980;text-indent:10px;height:28px;width:70%;}
		.erweima .div_file01{margin-left:10px;}
		.dn{display:none;}
		.weizi_img{max-width:500px;max-height:500px;}
		.codeimg{max-width:200px;max-height:200px;display:block;padding-bottom:10px;}
	</style>

    <script>
        $(document).ready(function(e) {
            $(".input_file01").hide();
            $(".button_shangchuan").click(function(){
                $("#uploadimg").click();
            });
            /*保存按钮*/
            $(".baocun").mouseover(function(){
                $(this).addClass("add_baocun")
            });
            $(".baocun").mouseleave(function(){
                $(this).removeClass("add_baocun")
            });
            /*弹出框隐藏显示*/
            $(".tupiankuang").hide();
            /*$(".yulan").click(function(){
                $(".tupiankuang").show();
                var srcs = $('#logourl').val();
                $('#yulan').attr('src',srcs);
                $("body").css({"overflow-y":"hidden","height":"100%"});
            });*/
            $(".x").mousemove(function(){
                $(this).attr("src","<{$ipath}>user/images/x_02.png")
            });
            $(".x").mouseleave(function(){
                $(this).attr("src","<{$ipath}>user/images/x_01.png")
            });
            $(".x").click(function(){
                $(".tupiankuang").hide();
                $("body").css({"overflow":"auto","height":"auto"});
            });
			
            $(".button_shangchuan2").click(function(){
                $("#uploadimg2").click();
            });
        });
	function viewimg(obj){
                $(".tupiankuang").show();
                var srcs = $(obj).val();
                $('#yulan').attr('src',srcs);
                $("body").css({"overflow-y":"hidden","height":"100%"});
	}
        /*切换*/
        $(function(){
			$(".case_hide").hide();
            $(".merchant_top li").click(function(){
				$(".case_hide").hide();
                $(this).addClass("li_active").siblings().removeClass("li_active");
                $("."+$(this).attr("id")).show()
            });
			<{if !empty($selnum)}>
			$("#<{$selnum}>").addClass("li_active").siblings().removeClass("li_active");
			$(".<{$selnum}>").show();
			<{else}>
			$(".company").show();
			<{/if}>
        });

        function setlatlng(longitude,latitude){
            art.dialog.data('longitude', longitude);
            art.dialog.data('latitude', latitude);
            // 此时 iframeA.html 页面可以使用 art.dialog.data('test') 获取到数据，如：
            // document.getElementById('aInput').value = art.dialog.data('test');
            art.dialog.open('?g=user&m=member&a=setLatLng_amap',{lock:false,title:'设置经纬度',width:600,height:400,yesText:'关闭',background: '#000',opacity: 0.87});
        }

        $(function(){
            new PCAS("province","city","district","<{if $info|@count neq 0 }><{$info.province}><{/if}>","<{if $info|@count neq 0 }><{$info.city}><{/if}>","<{if $info|@count neq 0 }><{$info.district}><{/if}>");
        });

        function checkwxfrm(){
            if($("#appid").val()==''/* || $("#appid").val()==null*/){
                alert('请填写应用ID(Appid)');
                return false;
            }else if($("#secret").val()==''/* || $("#secret").val()==null*/){
                alert('请填写应用秘钥(AppSecret)');
                return false;
            }else if($("#token").val()==''/* || $("#token").val()==null*/){
                alert('请填写Token令牌');
                return false;
            }else if($("#wxtype").val()==0 || $("#wxtype").val()=='0' || $("wxtype").val()==''){
				alert('请选择账号类型');
				return false;
			}
        };

        //检测服务窗表单
        function checkapfrm(){
            if($("#app_id").val()==''/* || $("#app_id").val()==null*/){
                alert('请填写服务窗APPID');
                return false;
            }else if($("#appname").val()==''/* || $("#appname").val()==null*/){
                alert('请填写服务窗名称');
                return false;
            }else if($("#redirect_uri").val()==''/* || $("#redirect_uri").val()==null*/){
                alert('请填写授权回调地址');
                return false;
            }else if($("#applyurl").val()==''/* || $("#applyurl").val()==null*/){
                alert('请填写应用网关');
                return false;
            }else if($("#private").val()==''/* || $("#private").val()==null*/){
                alert('请填写应用私钥');
                return false;
            }else if($("#public").val()==''/* || $("#public").val()==null*/){
                alert('请填写应用公钥');
                return false;
            };
        };

      //检测服务窗表单
        function checkalipayfrm(){
            if($("#partner_id").val()==''/* || $("#app_id").val()==null*/){
                alert('请填写PID(合作者身份ID)');
                return false;
            }else if($("#seller_email").val()==''/* || $("#appname").val()==null*/){
                alert('请填写收款账号');
                return false;
            }else if($("#key").val()==''/* || $("#redirect_uri").val()==null*/){
                alert('请填写KEY(安全检验码)');
                return false;
            }
            return true;
        };

    </script>
</head>

<body>
<!--图片弹框-->
<div class="tupiankuang">
    <!--<i class="x"></i>-->
    <img src="<{$ipath}>user/images/x_01.png" class="x">
	<div class="weizhi">
    	<img src="" id="yulan" class="weizi_img">
    </div>
</div>
<!--图片弹框-->
<div class="servicebox">
    <!--内容-->
    <div class="content01">
    	<div class="caibox">
        <p class="title">公司设置</p>
        <div class="content_merchant">
            <div class="merchant_top">
                <ul>
                    <li id="company" class="li_active">公司信息</li>
                    <li id="wx">公众号设置</li>
                    <li id="alip">服务窗设置</li>
                    <li id="alipay">支付宝设置</li>
                    <li id="pass">修改密码</li>
                </ul>
            </div>
            <!--表单部分-->
            <div class="hide_content">
                <div class="company_01 case_hide company">
                    <form class="form_set_up" action="" method="post" target="hiddfrm" onsubmit="return checkfrm('form_set_up');">
                        <!--复制-->
                        <div class="div_01">
                            <span><span class="red">*</span>名称</span>
                            <input type="text" name="name" class="div_input" <{if $info|@count neq 0 }>value="<{$info.name}>"<{/if}>>
                        </div>
                        <!--复制-->
                        <div class="div_01">
                            <span><span class="red">*</span>公司名称</span>
                            <input type="text" name="cname" class="div_input" <{if $info|@count neq 0 }>value="<{$info.cname}>"<{/if}>>
                        </div>
                        <!--复制-->
                        <div class="div_01">
                            <span><span class="red">*</span>综合分类</span>
                            <select class="div_select" name="cateid">
                                <option value="1" <{if $info.cateid==1}>selected='selected'<{/if}>>生活</option>
                                <option value="2" <{if $info.cateid==2}>selected='selected'<{/if}>>服务</option>
                                <option value="3" <{if $info.cateid==3}>selected='selected'<{/if}>>情感</option>
                                <option value="4" <{if $info.cateid==4}>selected='selected'<{/if}>>数码</option>
                                <option value="5" <{if $info.cateid==5}>selected='selected'<{/if}>>娱乐</option>
                                <option value="6" <{if $info.cateid==6}>selected='selected'<{/if}>>IT</option>
                                <option value="7" <{if $info.cateid==7}>selected='selected'<{/if}>>购物</option>
                                <option value="8" <{if $info.cateid==8}>selected='selected'<{/if}>>其他</option>
                            </select>
                        </div>
                        <!--复制-->
                        <div class="div_01">
                            <span><span class="red">&nbsp;&nbsp;</span>电话</span>
                            <input type="text" name="tel" class="div_input" <{if $info|@count neq 0 }>value="<{$info.tel}>"<{/if}>>
                        </div>
                        <!--复制-->
                        <div class="div_01">
                            <span><span class="red">*</span>手机</span>
                            <input type="text" name="phone" class="div_input" <{if $info|@count neq 0 }>value="<{$info.phone}>"<{/if}>>
                        </div>
                        <!--复制-->
                        <div class="div_01">
                            <span><span class="red">*</span>门店地址</span>
                            <select name="province"></select>
                            <select name="city"></select>
                            <select name="district"></select>
                        </div>
                        <!--复制-->
                        <div class="div_01">
                            <span><span class="red">*</span>详细地址</span>
                            <input type="text" name="address" class="div_input" <{if $info|@count neq 0 }>value="<{$info.address}>"<{/if}>>
                        </div>
                        <!--复制-->
                        <div class="div_01">
                            <span><span class="red">*</span>LOGO地址</span>
                            <input type="text"  placeholder="请输入url地址" name="logourl" id="logourl" class="div_input div_input02" <{if $info|@count neq 0 }>value="<{$info.logourl}>"<{/if}>>
                            <input type="button" value="本地上传" class="div_file01 button_shangchuan">
                            <!--隐藏-->
                            <input type="file" id="uploadimg" name="uploadimg" class="input_file01" onchange="uploadimgs('#logourl','uploadimg')">
                            <input type="button" value="预览" class="div_file01 yulan" onclick="viewimg('#logourl');">
                        </div>
                        <!--复制-->
                        <div class="div_01">
                            <span><span class="red">*</span>地理位置</span>
                            <span class="zuobiao01">经度（X）</span>
                            <input type="text" class="zuobiao02" id="longitude" name="longitude" <{if $info|@count neq 0 }>value="<{$info.longitude}>"<{/if}>>
                            <span class="zuobiao01">经度（X）</span>
                            <input type="text" class="zuobiao03" name="latitude" id="latitude" <{if $info|@count neq 0 }>value="<{$info.latitude}>"<{/if}>>
                            <input type="button" value="在地图中查看/设置" class="div_file01 button02" onclick="setlatlng($('#longitude').val(),$('#latitude').val())">
                        </div>
                        <!--复制-->
                        <div class="div_01 div_position">
                            <span class="first_span textarea_position">公司简介</span>
                            <textarea type="text" id="intro" name="intro" class="div_textarea" style="margin-left:140px;" ><{if $info|@count neq 0 }><{$info.intro}><{/if}></textarea>
                        </div>
                        <!--保存-->
                        <div class="baocunbox">
                            <input type="submit" class="baocun" value="保存">
                        </div>
                        <input type="hidden" name="cid" value="<{if $info|@count neq 0 }><{$info.id}><{/if}>" />
                    </form>
                </div>
                <!--微信部分-->
                <div class="case_hide wx">
                    <form class="form_set_up" action="?g=wx&m=weixin&a=wxusersave" target="hiddfrm" method="post">
                        <!--复制-->
                        <div class="div_01">
                            <span>微信号</span>
                            <input type="text" name="wxname" id="wxname" value="<{$wxinfo.wxname}>" class="div_input" >
                            <!--<img src="<{$ipath}>user/images/wen.png" class="wen">-->
                        </div>
                        <!--复制-->
                        <div class="div_01">
                            <span>公众号名称</span>
                            <input type="text" name="wxtitle" id="wxtitle" value="<{$wxinfo.wxtitle}>" class="div_input" >
                            <!--<img src="<{$ipath}>user/images/wen.png" class="wen">-->
                        </div>
                        <!--复制-->
                        <div class="div_01">
                            <span>账号类型</span>
                            <select name="wxtype" id="wxtype">
                            	<option value="0" <{if empty($wxinfo.wxtype)}>selected<{/if}>>请选择账号类型</option>
                            	<option value="1" <{if $wxinfo.wxtype==1}>selected<{/if}>>订阅号</option>
                                <option value="2" <{if $wxinfo.wxtype==2}>selected<{/if}>>服务号</option>
                                <option value="3" <{if $wxinfo.wxtype==3}>selected<{/if}>>认证订阅号</option>
                                <option value="4" <{if $wxinfo.wxtype==4}>selected<{/if}>>认证服务号</option>
                            </select>
                            <!--<img src="<{$ipath}>user/images/wen.png" class="wen">-->
                        </div>
                        <!--复制-->
                        <div class="div_01 erweibox">
                            <span class="erwei"><span class="red">*</span>二维码</span>
                            <div class="erweima"><{if !empty($wxinfo.rcode)}><img src="<{$wxinfo.rcode}>" class="codeimg"/><{/if}><input type="text" name="rcode" class="txt_code" id="codeurl" /><!-- <input type="file" name="rcode" /> --><input type="button" value="本地上传" class="div_file01 button_shangchuan2"><input type="button" value="预览" class="div_file01 yulan" onclick="viewimg('#codeurl');"><input type="file" id="uploadimg2" name="uploadimg" onchange="uploadimgs('#codeurl','uploadimg2')" class="dn"></div>
                        </div>
                        <!--复制-->
                        <div class="div_01">
                            <span><span class="red">*</span>AppID(应用ID)</span>
                            <input type="text" name="appid" id="appid" value="<{$wxinfo.appid}>" class="div_input" >
                            <!--<img src="<{$ipath}>user/images/wen.png" class="wen">-->
                        </div>
                        <!--复制-->
                        <div class="div_01 two_line">
                            <!--<span><span class="red">*</span>AppSecret(应用密钥)</span>-->
                            <span class="span_box">
                                <span class="red">*</span><span>AppSecret</span>
                                <span class="last_span">(应用秘钥)</span>
                        	</span>
                            <input type="text" name="secret" id="secret" value="<{$wxinfo.secret}>" class="div_input two_input" >
                            <!--<img src="<{$ipath}>user/images/wen.png" class="wen">-->
                        </div>
                        <div class="div_01">
                            <span>公众平台绑定URL</span>
                            <{$wxseturl}>
                            <!--<img src="<{$ipath}>user/images/wen.png" class="wen">-->
                        </div>
                        <!--复制-->
                        <div class="div_01">
                            <span><span class="red"></span>Token(令牌)</span>
                            <input type="text" name="token" id="token" value="<{$wxinfo.token}>" class="div_input" >
                            <!--<img src="<{$ipath}>user/images/wen.png" class="wen">-->
                        </div>
                        <!--复制-->
                        <div class="div_01 two_line">
                            <!--<span>AesEncodingKey(消息加解密密钥)</span>-->
                            <span class="span_box">
                                <span class="red">*</span><span>AesEncodingKey</span>
                                <span class="last_span">(消息加解密密钥)</span>
                            </span>
                            <input type="text" name="aeske" id="aeske" value="<{$wxinfo.aeske}>" class="div_input two_input" >
                            <!--<img src="<{$ipath}>user/images/wen.png" class="wen">-->
                        </div>
                        <!--复制-->
                        <div class="div_01">
                            <span>商户号</span>
                            <input type="text" name="shopid" id="shopid" value="<{$wxinfo.shopid}>" class="div_input" >
                            <!--<img src="<{$ipath}>user/images/wen.png" class="wen">-->
                        </div>
                        <!--复制-->
                        <div class="div_01">
                            <span>商户支付秘钥</span>
                            <input type="text" name="shopkey" id="shopkey" value="<{$wxinfo.shopkey}>" class="div_input" >
                            <!--<img src="<{$ipath}>user/images/wen.png" class="wen">-->
                        </div>
                         
                        <!--保存-->
                        <div class="baocunbox">
                            <input type="submit" class="baocun" value="保存"  onClick="return checkwxfrm()">
                        </div>
                    </form>
                </div>
                <!--服务窗部分-->
                <div class="case_hide alip">
                    <form class="form_set_up" action="?g=alipay&m=user&a=saveuser" target="hiddfrm" method="post">
                        <!--商户id-->
                        <div class="div_01">
                            <span><span class="red">*</span>APPID</span>
                            <input type="text" name="appid" id="app_id" class="div_input" value="<{$apinfo.appid}>" />
                        </div>
                        <div class="div_01">
                            <span><span class="red">*</span>服务窗名称</span>
                            <input type="text" name="appname" id="appname" class="div_input" value="<{$apinfo.appname}>" />

                        </div>
                        <!--<div class="div_01">
                            <span><span class="red">*</span>授权回调地址</span>
                            <input type="text" readonly name="redirect_uri" id="redirect_uri" value="?g=fuwu&m=index&a=index" class="div_input" >

                        </div>-->

                        <div class="div_01">
                            <span><span class="red">*</span>应用网关</span>
                            <input type="text" readonly name="applyurl" id="applyurl" value="<{$basehost}>?g=alipay&m=gateway&a=index&userid=<{$smarty.session.userinfo.userid}>" class="div_input" >
                        </div>
                        <div class="div_01">
                            <span><span class="red">*</span>应用私钥（RSA）</span>
                            <textarea name="merchant_private_key" id="private" cols="90" readonly rows="15">-----BEGIN RSA PRIVATE KEY-----
MIICWwIBAAKBgQCo+xhfG4O4EZJoqFjaLzU4ihZto1iLpRx/z+FwBDd2Qj2bI4JH
lNPuA0g58g6mUrnAgtraFhirGIevFpMxQznEVY9h3vX0+gOo/KnNIvXq7rZNoq1C
MQmOFa/aYYU/hDdEZU5aAQcnx0g7t1AoqcqH4pJ5yXhqZ/6L8jm23BKu6QIDAQAB
AoGAGfBRUWgb1Al+e+o7mWJdvQwVXUcRtH3n3ga/CD7ddJ2+by4INYy263Y9hAeQ
EB/qu45aodd6eekOCuZgOdOj7iuDs/zAC6LqNDPRBVQuqlKiBsLPRs8iYSEXkYG8
nu2OJvMy2alfpTa5MuCw+rayrP8UISO1eD+aA22nNKF6f8ECQQDVmhe+neGq5nMI
kk6nrJSpY7XAg5LOviw3LDd9yP6PpxmE/8llUsSepvEtwaG/75Qg1YCYot3SNPP/
wL2y7xaFAkEAyoWjsHoQLhZp0IlD7BGyQVgN8A5dR8yL0d/knLvuc112rMF2i2KV
sAzXd6U9vDfkv8aJOgfVim5qQJRl9L1eFQJANMfIyj80/gfHsPyGFwScD2cmCBX6
9r8jKdbxN1GtJU4DDkwuNa1IDHPv8ICCOW03yw02o4DLEyAmkrHLriVKCQJAMWWR
PG05XxRmcM/aOk1Crj98/s1yIR4aCHHUwAnyqj7kwFRbxrmgCxXGxE8QlMUJTWFu
fTIF+sLdtay8hYpe1QJAVsl162vufLwPUGBHiX7NaKYSUrPC7/fVIOmK83oVRATv
IR44sgNcDcU7qurxORyufseebf2LSKh7DRD4jMVqHg==
-----END RSA PRIVATE KEY-----
</textarea>
                            <!--<input type="text" name="merchant_private_key" id="private" value="" class="div_input" >-->

                        </div>
                        <div class="div_01">
                            <span><span class="red">*</span>应用公钥（RSA）</span>
                            <textarea name="merchant_public_key" id="public" cols="90"  readonly="readonly" rows="6">-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCo+xhfG4O4EZJoqFjaLzU4ihZt
o1iLpRx/z+FwBDd2Qj2bI4JHlNPuA0g58g6mUrnAgtraFhirGIevFpMxQznEVY9h
3vX0+gOo/KnNIvXq7rZNoq1CMQmOFa/aYYU/hDdEZU5aAQcnx0g7t1AoqcqH4pJ5
yXhqZ/6L8jm23BKu6QIDAQAB
-----END PUBLIC KEY-----
</textarea>
                            <!--<input type="text" name="merchant_public_key" id="public" value="" class="div_input" >-->

                        </div>

                        <!--保存-->
                        <div class="baocunbox">
                            <input type="submit" style="cursor: pointer;" class="baocun" value="保存" onClick="return checkapfrm()" />
                        </div>
                    </form>
                </div>
                <!--支付宝部分-->
                <div class="case_hide alipay">
                    <form class="form_set_up" action="?g=alipay&m=user&a=save" method="post">
                        <!--商户id-->
                        <div class="div_01">
                            <span><span class="red">*</span>PID(合作者身份ID)</span>
                            <input type="text" name="partner_id" id="partner_id" class="div_input" value="<{$apinfo.alipay_partner_id}>" />
                        </div>
                        <div class="div_01">
                            <span><span class="red">*</span>收款支付宝账号</span>
                            <input type="text" name="seller_email" id="seller_email" class="div_input" value="<{$apinfo.alipay_seller_email}>" />
                        </div>
                        <div class="div_01">
                            <span><span class="red">*</span>KEY(安全检验码)</span>
                            <input type="text" name="key" id="key" class="div_input" value="<{$apinfo.alipay_key}>" />
                        </div>
                        <div class="div_01">
                            <span>支付接口类型</span>
                            <select name="paytype" id="wxtype">
                            	<option value="wap" <{if $apinfo.alipay_paytype == 'wap'}>selected<{/if}>>手机网站支付</option>
                            	<option value="escow" <{if $apinfo.alipay_paytype == 'escow'}>selected<{/if}>>担保交易</option>
                                <option value="direct" <{if $apinfo.alipay_paytype == 'direct'}>selected<{/if}>>即时到账</option>
                            </select>
                            <!--<img src="<{$ipath}>user/images/wen.png" class="wen">-->
                        </div>
                        <!--保存-->
                        <div class="baocunbox">
                            <input type="submit" style="cursor: pointer;" class="baocun" value="保存" onClick="return checkaalipayfrm()" />
                        </div>
                    </form>
                </div>
                <!--修改密码-->
                <div class="case_hide pass">
                    <form class="form_set_up" action="?g=user&m=member&a=modifyPwd" method="post" target="hiddfrm" onSubmit="return checkpassword()">
                        <!--商户id-->
                        <div class="div_01">
                            <span><span class="red">*</span>原密码</span>
                            <input type="password" name="oldpass" id="oldpass" class="div_input" value="" />
                        </div>
                        <!--复制-->
                        <div class="div_01">
                            <span><span class="red">*</span>新密码</span>
                            <input type="password" name="password" id="password" class="div_input" value="" />

                        </div>
                        <div class="div_01">
                            <span><span class="red">*</span>新密码确认</span>
                            <input type="password" id="password2" value="" class="div_input" >

                        </div>
                        <!--保存-->
                        <div class="baocunbox">
                            <input type="submit" style="cursor: pointer;" class="baocun" value="保存" />
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <!--选项站位-->
        <P class="zhanwei"></P>
        </div>
    </div>

</div>
<script>
var K=window.KindEditor;
K.create("#intro",{widht:"80%",height:"200px",cssPath:"lib/kdeditor/plugins/code/prettify.css",uploadJson:"lib/kdeditor/php/upload_json.php",fileManagerJson:"lib/kdeditor/php/file_manager_json.php",allowFileManager:true,});
function uploadimgs(obj,btn){
	var url = "?g=user&m=member&a=uploadimg";
	$.ajaxFileUpload({
		url:url,
		dataType:'json',
		fileElementId:btn,
		type:'post',
		secureuri:false,
		success:function(data){
			if(data.status==1){
				$(obj).val(data.msg);
				console.log($(obj).val())
			}else{
				alert(data.msg);
				return false;
			}
		}
	});
};
	
	function checkpassword(){
		if($("#oldpass").val()=='' || $("#oldpass").val()==null){
			alert('请填写原密码');
			return false;
		}else if($("#password").val()=='' || $("#password").val()==null){
			alert('请填写新密码');
			return false;
		}else if($("#password2").val()=='' || $("#password2").val()==null){
			alert('请填写新密码确认');
			return false;
		}else if($("#password").val() != $("#password2").val()){
			alert('两次新密码不匹配');
			return false;
		}
	}
    function isMobile(mobile) {
        return (/^(13[0-9]\d{8}|15[0-9]\d{8}|18[0-9]\d{8}|14[0-9]\d{8})$/.test(mobile));
    }
    function isRange(value) {
        return (/^\d+(\.\d+)?$/.test(value));
    }
    function checkfrm(form){
        var name = $("."+form+" input[name='name']").val(),
            cname = $("."+form+" input[name='cname']").val(),
            phone = $("."+form+" [name='phone']").val(),
            address = $("."+form+" [name='address']").val(),
            logourl = $("."+form+" [name='logourl']").val(),
            longitude = $("."+form+" [name='longitude']").val(),
            latitude = $("."+form+" [name='latitude']").val();

        if(name=='' || name==null){
            alert("请输入名称");
            return false;
        }
        if(cname=='' || cname==null){
            alert('请输入商户名称');
            return false;
        }
        if(phone=='' || phone==null){
            alert("请输入手机");
            return false;
        }
        if(!isMobile(phone)){
            alert("手机格式不正确");
            return false;
        }
        if(address=='' || address==null){
            alert('请输入详细地址');
            return false;
        }
        if(logourl=='' || logourl==null){
            alert("请输入LOGO地址");
            return false;
        }
        if(!isRange(longitude)){
            alert('经度格式不正确');
            return false;
        }
        if(!isRange(latitude)){
            alert("纬度格式不正确");
            return false;
        }
    }
</script>
<iframe width="0" height="0" name="hiddfrm" id="hiddfrm" style="display:none"></iframe>
</body>
</html>
